Fix parser joining ordinary Fortran continuation lines (issue #537)#538
Merged
Fix parser joining ordinary Fortran continuation lines (issue #537)#538
Conversation
…ssue #537) Only join & continuation lines for pFUnit @-directive lines; pass ordinary Fortran continuation lines through unchanged. This prevents multi-line array constructors from being collapsed into a single line and avoids embedded Fortran comments breaking generated code. - Restore nextLine() to return one physical line at a time - Add isDirectiveLine() helper method - Add joinContinuationLines() called only for @-directive lines in run() - Initialize looking_for_test_name and current_method in Parser.__init__ - Rewrite test_parser_continuation.py to test correct behaviour - Update ChangeLog
213e5b0 to
840650e
Compare
mathomp4
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #537. PR #533 introduced a regression where
Parser.nextLine()joined all Fortran&continuation lines, not just those belonging to@-directive lines. This caused two failures in ordinary Fortran code:! ScenarioDescription(...), &) became embedded mid-statement, producing invalid Fortran.Changes
pFUnitParser.py:nextLine()reverted to simple one-physical-line-at-a-time behaviourisDirectiveLine(line)— detects lines beginning with@joinContinuationLines(line)— joins&continuations, called only for@-directive lines inrun()Parser.__init__: initializelooking_for_test_nameandcurrent_method(latent missing init)testParser.py: addTestFortranContinuationPassthroughwith three regression tests